﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace WindowsFormsApp3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
      
        public  static  readonly Dictionary<String, String> _user = new Dictionary<string, string>();

      
        private void textBox1_TextChanged(object sender, EventArgs e)
        {

           

        }

        private void label2_Click(object sender, EventArgs e)
        {
            
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
          
        }

        private void button1_Click(object sender, EventArgs e)
        {
            


            var uid = userName.Text;
            var Pwd = PassWord.Text;
            var res = _user.Where(x => x.Key == uid).FirstOrDefault();
            if (res .Key ==uid &&res .Value==Pwd )
            {
                MessageBox.Show("登录成功");

            }
            else
            {
                MessageBox.Show("登录失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            RegisterForm registerForm = new RegisterForm();
            registerForm.Show();
        }

        private void Form1_Load_1(object sender, EventArgs e)
        {
            _user.Add("Demo", "123456");
        }
    }
}
